﻿using System.Globalization;

namespace BrasilFramework.Controle.WPF.Comum
{
    public class ExpressaoRegular
    {
        public const string RE_LETRA = @"[a-zA-Z]";
        public const string RE_NUMERO = @"\d";
        public const string RE_SEPARADORES = @"[\.\/,\-\:\(\)\ ]";

        public readonly string RE_NUMERO_GLOBAL = @"^-?((\d{1,3}\.)*\d{3}|\d*" +
                                                  NumberFormatInfo.CurrentInfo.NumberDecimalSeparator +
                                                  @"{0,1}\d+|(\d{1,3}\.)*\d{3},{0,1}\d+|\d*)$";

        /// <summary>
        /// Pattern Expressão Regular para validação de endereço eletrônico.
        /// </summary>
        public const string ENDERECO_ELETRONICO = @"^([a-z0-9_\-])([a-z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-z0-9\-]+)\.)+))([a-z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$";

        /// <summary>
        /// Validação de data
        /// </summary>
        public const string DATA = @"(?<day>\d?\d)[-/](?<month>\d?\d)[-/](?<year>\d+)";

        /// <summary>
        /// Validação de hora
        /// </summary>
        public const string HORA = @"^([0-1][0-9]|[2][0-3]):[0-5][0-9]$";
    }
}